From 373ce9f6528e095ca388ee374690492266b87222 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 30 Nov 2015 10:35:04 -0500 Subject: [PATCH] stack: Update windows before allocating children Doing things the other way around seems to cause problems in some cases where children want to do different things depending on the window position. https://bugzilla.gnome.org/show_bug.cgi?id=758563 --- gtk/gtkstack.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index bc9e347899..09ee656091 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2183,6 +2183,16 @@ gtk_stack_size_allocate (GtkWidget *widget, gtk_widget_set_allocation (widget, allocation); + if (gtk_widget_get_realized (widget)) + { + gdk_window_move_resize (priv->view_window, + allocation->x, allocation->y, + allocation->width, allocation->height); + gdk_window_move_resize (priv->bin_window, + get_bin_window_x (stack, allocation), get_bin_window_y (stack, allocation), + allocation->width, allocation->height); + } + child_allocation.x = 0; child_allocation.y = 0; child_allocation.width = allocation->width; @@ -2218,16 +2228,6 @@ gtk_stack_size_allocate (GtkWidget *widget, gtk_widget_size_allocate (priv->visible_child->widget, &child_allocation); } } - - if (gtk_widget_get_realized (widget)) - { - gdk_window_move_resize (priv->view_window, - allocation->x, allocation->y, - allocation->width, allocation->height); - gdk_window_move_resize (priv->bin_window, - get_bin_window_x (stack, allocation), get_bin_window_y (stack, allocation), - allocation->width, allocation->height); - } } -- 2.30.2